
from django.urls import path, re_path

from . import views

app_name='users'
urlpatterns = [
    path('register/',views.RegisterView.as_view(),name='register'),
    re_path('usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count',views.UsernameCountView.as_view()),
    re_path('mobiles/(?P<mobile>1[3-9]\d{9})/count',views.MobileCountView.as_view()),
    path('login/',views.LoginView.as_view(),name='login'),
    path('info/',views.InfoView.as_view(),name='info'),
    path('logout/',views.LogoutView.as_view(),name='logout'),
    # 添加邮箱
    path('emails/',views.EmailView.as_view()),
    # 验证邮箱
    path('emails/verification/',views.VerifyEmailView.as_view()),
    # 收货地址显示
    path('addresses/', views.AddressView.as_view(),name='address'),
    # 收货地址新增
    path('addresses/create/',views.AddressCreateView.as_view()),
    # 收货地址修改
    re_path('^addresses/(?P<address_id>\d+)/$', views.UpdatedDestoryAddressView.as_view()),
    # 设置默认地址
    re_path('addresses/(?P<address_id>\d+)/default/', views.DefaultAddressView.as_view()),
    # 更新地址标题
    re_path('addresses/(?P<address_id>\d+)/title/', views.UpdateTitleAddressView.as_view()),

]